package com.csun.cmny.provider.dto;

import com.csun.cmny.provider.validator.OmcOldLeaveValidator;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class OmcOldLeaveDto {
    /**
     * 请假记录id
     */
    private Long id;

    /**
     * 组织Id
     */
    private Long groupId;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 老人id
     */
    @NotNull(message = "{MedicationPlan.oldman.id.notnull}",
            groups = {OmcOldLeaveValidator.class})
    private Long oldManId;

    /**
     * 请假日期
     */
    @NotNull(message = "{EmpLeave.qingjia.date.notnull}",
            groups = {OmcOldLeaveValidator.class})
    @Pattern(regexp = "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message = "{OldLeave.qinjia.date.error}",
            groups = {OmcOldLeaveValidator.class})
    private String leaveDate;

    /**
     * 拟回院日期
     */
    @NotNull(message = "{OldLeave.backDate.notnull}",
            groups = {OmcOldLeaveValidator.class})
    @Pattern(regexp = "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message = "{OldLeave.backDate.error}",
            groups = {OmcOldLeaveValidator.class})
    private String returnDate;

    /**
     * 实际回院日期
     */
    private String realDate;

    /**
     * 请假原因 1 回家；2 和好友外出；3 院外就医； 4 院内就医
     */
    @NotNull(message = "{EmpLeave.qingjia.type.notnull}",
            groups = {OmcOldLeaveValidator.class})
    @Range(min = 1, max = 4, message = "{OldLeave.qinjia.range.error}",
            groups = {OmcOldLeaveValidator.class})
    private Integer type;

    /**
     * 请假说明
     */
    @Length(min = 1, max = 128, message = "{OldLeave.dec.length}",
            groups = {OmcOldLeaveValidator.class})
    private String desc;

    /**
     * 退费天数--计算用
     */
    private Integer realRefundDays;

    /**
     * 退费天数 展示用
     */
    private Integer refundDays;

    /**
     * 请假退费金额
     */
    private BigDecimal refundFee;

    /**
     * 请假退费周期数
     */
    private BigDecimal returnDegree;


    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建人ID
     */
    private Long creatorId;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 最近操作人
     */
    private String lastOperator;

    /**
     * 最后操作人ID
     */
    private Long lastOperatorId;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 班组Id
     */
    private Long nursingGroupId;



}